<template>
  <div class="mod-config">
    <table-view ref="view"
                :searchAttrs="searchAttrs"
                :primaryKey="primaryKey"
                :listApiName="listApiName"
                :deleteApiName="deleteApiName"
                :saveAuthName="saveAuthName"
                :deleteAuthName="deleteAuthName"
                :showAttrs="showAttrs"
    >
    </table-view>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  </div>
</template>

<script>
import AddOrUpdate from './modelcategory-add-or-update'
import tableView from '@/components/tableView'
import basicMixins from '@/utils/commonViewMixins'

export default {
  mixins: [basicMixins],
  data() {
    return {
      searchAttrs: {},
      showAttrs: {
        modelCategoryName: {label: '模具类别名称'},
        parentId: {label: '父id'},
        createUser: {label: '创建人员'},
        createTime: {label: '创建时间', type: 'date'},
        updateUser: {label: '修改人员'},
        updateTime: {label: '修改时间', type: 'date'},
        status: {
          label: '状态',
          type: 'radio',
          items: [
            {value: 0, text: '禁用', tagType: 'danger'},
            {value: 1, text: '正常'}
          ]
        }
      },
      primaryKey: 'id',
      listApiName: 'modelApi/listModelCategory',
      deleteApiName: 'modelApi/deleteModelCategory',
      saveAuthName: 'model:modelcategory:save',
      deleteAuthName: 'model:modelcategory:delete'
    }
  },
  components: {
    AddOrUpdate,
    tableView
  }
}
</script>
